/***********************************************************
 * Product Name: ExcelQuicker
 * Copyright (c)2005, Eunge
 * Author: Eunge
 * Web Site: www.eudev.net
 * Mail/MSN: eudev.net@yeah.net
 * ********************************************************/
using System;

namespace ExcelQuicker.Framework
{
	/// <summary>
	/// Base class of all style
	/// </summary>
	[Serializable]
	public abstract class EQStyleBase: EQObject
	{
		private EQEventRangeHandler mAfterOperationEvent;
		private EQEventRangeHandler mBeforeOperationEvent;

		/// <summary>
		/// Raised after operation
		/// </summary>
		public EQEventRangeHandler AfterOperationEvent
		{
			get
			{
				return mAfterOperationEvent;
			}
			set
			{
				this.mAfterOperationEvent = value;
			}
		}

		/// <summary>
		/// Raised before operation
		/// </summary>
		public EQEventRangeHandler BeforeOperationEvent
		{
			get
			{
				return mBeforeOperationEvent;
			}
			set
			{
				this.mBeforeOperationEvent = value;
			}
		}

		/// <summary>
		/// Output style on the excel document
		/// </summary>
		/// <param name="objRange"></param>
		protected internal abstract void Output(Excel.Range objRange);

		/// <summary>
		/// Execute BeforeOperationEvent delegate
		/// </summary>
		/// <param name="objRange"></param>
		protected void DoBeforeOperationEvent(Excel.Range objRange)
		{
			if(this.BeforeOperationEvent != null)
				this.BeforeOperationEvent(objRange);
		}

		/// <summary>
		/// Execute AfterOperationEvent delegate
		/// </summary>
		/// <param name="objRange"></param>
		protected void DoAfterOperationEvent(Excel.Range objRange)
		{
			if(this.AfterOperationEvent != null)
				this.AfterOperationEvent(objRange);
		}
	}
}